package com.css.filexml.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.ip.udp.UnicastReceivingChannelAdapter;

/**
 * UDP配置
 *
 * @author 一朝风月
 * @date 2021/12/16 14:54
 */
@Configuration
public class UdpConfig {
    @Bean
    public IntegrationFlow integrationFlow() {
        return IntegrationFlows.from(new UnicastReceivingChannelAdapter(12345))
                .handle("FileXmlServer", "handleMessage")
                .get();
    }
}
